<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <h:head>        
        <title>Facelet Title</title>
        
        <script>
                function val()
                {
                    location.href="/Sistema/faces/Sistema.xhtml";
                }
            </script>
    </h:head>


    <h:form id="form2">
        <h:body>
            
            <p:growl id="growl" showDetail="true" life="3000" showSummary="true" />
            <p:dialog id="dialog" header="Login" widgetVar="dlg" resizable="false" visible="true">  

                <h:panelGrid columns="2" cellpadding="5">  
                    <h:outputLabel for="username" value="Username:" />  
                    <p:inputText value="#{loginBean.username}"
                                 id="username" required="true" label="username" />
                    
                    <h:outputLabel for="password" value="Password:" />  
                    <h:inputSecret value="#{loginBean.password}"   
                                   id="password" required="true" label="password" />  

                    <f:facet name="footer">
                        <center>
                        <p:commandButton id="loginButton" value="Login" update="growl"   
                                         actionListener="#{loginBean.login}"/>         
                        <br/>
                        <p:commandLink id="loginButtond" value="Cadastro" style="font-size:12px; color: red"
                                       onclick="val();" />
                        </center>
                    </f:facet>  
                </h:panelGrid>  

            </p:dialog>  
        </h:body>
    </h:form>

</html>
